package com.nbsaas.boot.product.rest.resource;

import com.nbsaas.boot.product.api.apis.SpecValueApi;
import com.nbsaas.boot.product.data.entity.SpecValue;
import com.nbsaas.boot.product.api.domain.request.SpecValueRequest;
import com.nbsaas.boot.product.api.domain.response.SpecValueResponse;
import com.nbsaas.boot.product.api.domain.simple.SpecValueSimple;
import com.nbsaas.boot.product.rest.convert.SpecValueSimpleConvert;
import com.nbsaas.boot.product.rest.convert.SpecValueEntityConvert;
import com.nbsaas.boot.product.rest.convert.SpecValueResponseConvert;
import com.nbsaas.boot.product.data.repository.SpecValueRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   规格值-业务接口实现
*/
@Transactional
@Service
public class SpecValueResource extends BaseResource<SpecValue,SpecValueResponse, SpecValueSimple, SpecValueRequest>  implements SpecValueApi {

    @Resource
    private SpecValueRepository specValueRepository;

    @Override
    public JpaRepositoryImplementation<SpecValue, Serializable> getJpaRepository() {
        return specValueRepository;
    }

    @Override
    public Function<SpecValue, SpecValueSimple> getConvertSimple() {
        return new SpecValueSimpleConvert();
    }

    @Override
    public Function<SpecValueRequest, SpecValue> getConvertForm() {
        return new SpecValueEntityConvert();
    }

    @Override
    public Function<SpecValue, SpecValueResponse> getConvertResponse() {
        return new SpecValueResponseConvert();
    }




}


